package com.jt.controller;

import com.jt.pojo.User;
import com.jt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {

    @Autowired
    @Qualifier("userServiceA")
    private UserService userService;

    @Autowired  //从容器中动态获取对象
    private User user;

    public void addUser(){

        /*User user=new User();
        user.setId(911);
        user.setUsername("马尔扎哈");*/
        userService.addUser(user);
    }

}
